﻿using System.IO;
using System.Web.Mvc;
using Ctef.Web.Repositories;

namespace Ctef.Web.Controllers
{
    public class AboutController : Controller
    {
        [HttpGet]
        public ActionResult Index()
        {
            return RedirectToAction("Mission");
        }

        [HttpGet]
        public ActionResult Mission()
        {
            return View();
        }

        [HttpGet]
        public ActionResult SchoolMap()
        {
            SchoolRepository.Instance.Initialize(Path.Combine(Request.PhysicalApplicationPath, "Resources/SchoolInfo"));
            ViewData["schooldata"] = SchoolRepository.Instance.SchoolDataJson;
            return View();
        }

        [HttpGet]
        public ActionResult Finance()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Contact()
        {
            return View();
        }

        [HttpGet]
        public ActionResult SisterOrgs()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Faq()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Team()
        {
            return View();
        }

        protected override void HandleUnknownAction(string actionName)
        {
            this.View("Mission").ExecuteResult(this.ControllerContext);
        } 
    }
}
